<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 85167
  Date: 2017/12/10
  Time: 11:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <c:import url="/WEB-INF/page/header.jsp"/>
</head>
<body>
<div class="col-md-12">
    <form class="form-inline" id="inputForm" action="${pageContext.request.contextPath}/admin/menu/save" method="post">
        <input type="hidden" name="id" value="${info.id}">
        <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
            <tbody>
            <tr>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>上级菜单：</label></td>
                <td class="width-35">
                    <select class="form-control" name="pid">
                        <option value="0" selected="selected">无上级</option>
                        <c:forEach items="${menus}" var="vo">
                            <option value="${vo.id}"
                                    <c:if test="${info.pid eq vo.id}">selected="selected"</c:if>>${vo.name}</option>
                        </c:forEach>
                    </select>
                </td>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>菜单名称：</label></td>
                <td class="width-35">
                    <input type="text" name="name" class="form-control" placeholder="请输入名称" value="${info.name}"
                           required=""
                           aria-required="true">
                </td>
            </tr>
            <tr>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>链接：</label></td>
                <td class="width-35">
                    <input type="text" name="url" class="form-control" placeholder="请输入链接" value="${info.url}">
                </td>
                <td class="width-15 active"><label class="pull-right"><font color="red">*</font>排序：</label></td>
                <td class="width-35">
                    <input type="text" name="sort" class="form-control" placeholder="" value="${info.sort}" required=""
                           aria-required="true">
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
<c:import url="/WEB-INF/page/footer.jsp"/>
<script type="text/javascript">
    $().ready(function () {
        $("#menuForm").validate();
    });


    function save() {
        saveData(base + "/admin/menu/save", $("#menuForm").serialize());
    }

    function cancel() {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        setTimeout(parent.layer.close(index), 2000);
        parent.location.reload(true);
    }
</script>
</body>
</html>
